<template>
	<view>
		<view class="top">
			<view class="in" :style="{'height':small}">
				<view class="search">
					<text style="color:#3082fa ; font-size: 25rpx;">
						输入核销码
					</text>
					<input type="text"  class="input" v-model="operate.code">
					<button class="btn" @click="submit">识别</button>
					</input>
				</view>
			</view>
			<block v-if="operate.code!=null">
			<verificationCode :operate="operate"></verificationCode>
			<view>
				<button class="surebtn" @tap="tapPopup" v-if="sure==0">确认核销</button>
				<button class="surebtn" disabled="true" v-if="sure==1">已核销</button>
			</view>
			</block>
			<!-- 弹窗 -->
			<popup :show="show" @close="close"></popup>
		</view>
	</view>
</template>

<script>
	export default {
	
		data() {
			return {
				sure:0,
				show:false,
					small:'100vh',
				operate:{
					code:null,
					content:['xxx标准洗车服务包含','整车泡沫冲洗擦T','轮胎轮毂冲洗清洁','车内吸尘','内饰脚垫简单除尘','(不包含虫户、水泥、沥青和顽固污渍清理等)'],
					orderDl:{
						picer:'￥30.00',
						paid:'￥25.00',
						preferential:'￥5.00',
						orderNum:'2020032554376799',
						payTime:'2020.03.30 14:20:45',
						bookingTime:'2020.03.29 15:20:45'
					}
				}
			}
		},
		onLoad(code){
			if(code!=null){
				this.operate.code=code.code;
		this.submit()
		}
		},
		methods: {
			close(close,sure){
	this.sure=sure;
	console.log(sure);
				this.show = close;
				
			},
			tapPopup() {
				this.show = true;
			},
			submit(){
				if(this.operate.code!=null){
					this.small='10vh'
				}
			}
		}
	}
</script>

<style>
.top{
	width: 100vw;
	height: 25vh;
	background-color: #3082fa;
	position: absolute;

}
.in{
	width: 95vw;
	border-radius: 10rpx 10rpx 10rpx 10rpx;
	background-color: white;
	margin: 0 auto;
	box-shadow: 2rpx 2rpx 2rpx 2rpx rgba(0, 0, 0, 0.2);
	
}
.search{
	width: 90%;
	height: 10vh;
	margin: 0 auto;
	display: flex;
 align-items: center;
 
}
.input{
	padding-left: 2vw;
	border: 1rpx solid #dcdcdc;
	border-radius: 50rpx 50rpx 50rpx 50rpx;
left: 2vw;
	width: 70%;
	height: 50%;
	position: relative;
	z-index: 5;
	font-size: 25rpx;
}
.btn{
	color: white;
	background-color: #3082fa;
	border-radius: 50rpx 50rpx 50rpx 50rpx;
	position: absolute;
	right: 13vw;
	font-size: 23rpx;
	width: 120rpx;
	height:60rpx;
	z-index: 20;
}
.surebtn{
	width: 60vw;
	font-size: 25rpx;
	border-radius: 50rpx 50rpx 50rpx 50rpx;
	background-color: #3082fa;
	color: white;
	
}
.surebtn[disabled]{
	width: 60vw;
	font-size: 25rpx;
	border-radius: 50rpx 50rpx 50rpx 50rpx;
	background-color: #7f7f7f !important;
	color: white !important;
	
}

</style>
